filedir = 'E:/0051.txt'
def putInfoToDict(fileName):
    outInfoToDict = {}
    with open (fileName) as rfile:
        lines = rfile.read().splitlines()
        # print(lines)
        for line in lines:
            # print(line)
            line = line.replace('(','').replace(')','').replace("'","").replace(';','')
            # print(line)
            temp = line.split(',')
            checkTime = temp[0].strip()
            # print(checkTime)
            lessonTd = int(temp[1].strip())
            # print(lessonTd)
            userid =int(temp[2].strip())
            # print(userid)
            toDict = {'lessonid':lessonTd,'checkintime':checkTime}
            # print(toDict)
            if userid not in outInfoToDict:
                outInfoToDict[userid] = []
            outInfoToDict[userid].append(toDict)
    return outInfoToDict
from pprint import pprint
pprint(putInfoToDict(filedir))
